package com.usian.service;

import com.usian.mappers.UserMapper;
import com.usian.pojo.Dto;
import com.usian.pojo.Etc;
import com.usian.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserService {
   @Autowired
   private UserMapper userMapper;

    public User findOne(User user) {
      String  username=user.getUsername();
      String psw=user.getPsw();
      Integer rid=user.getRid();
      return   userMapper.findOne(username,psw,rid);
    }

    public List<Etc> findAll() {
        return userMapper.FindAll();
    }

    public void add(User user) {
        user.setZtime(new Date());
        userMapper.insertSelective(user);
    }
}
